<html>
<head><meta charset="utf-8"><title>startup time · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/startup.20time.html">startup time</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="195331773"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/startup%20time/near/195331773" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Bastien Orivel <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/startup.20time.html#195331773">(Apr 26 2020 at 12:07)</a>:</h4>
<p>Hey, I'm using vim with coc-rust-analyzer and while it works pretty well the startup time is a pretty big problem. My workflow involves a lot of quitting/reopening vim which makes rust-analyze start from scratch every time. Is there any work in progress to get better starting time or caching ?</p>



<a name="195331909"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/startup%20time/near/195331909" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/startup.20time.html#195331909">(Apr 26 2020 at 12:10)</a>:</h4>
<p>If you read the code for a while before invoking any rust-analyzer commands, <a href="https://github.com/rust-analyzer/rust-analyzer/pull/4133" title="https://github.com/rust-analyzer/rust-analyzer/pull/4133">https://github.com/rust-analyzer/rust-analyzer/pull/4133</a> (merged yesterday) will help a little. But there's no support for persisting the database.</p>



<a name="195331932"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/startup%20time/near/195331932" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Bastien Orivel <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/startup.20time.html#195331932">(Apr 26 2020 at 12:11)</a>:</h4>
<p>Well it seems to re run cargo check every time. Is that expected ?</p>



<a name="195331972"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/startup%20time/near/195331972" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/startup.20time.html#195331972">(Apr 26 2020 at 12:12)</a>:</h4>
<p>Yes by default, but it should be fast if there are no modifications.</p>



<a name="195331989"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/startup%20time/near/195331989" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/startup.20time.html#195331989">(Apr 26 2020 at 12:12)</a>:</h4>
<p>There's no immediate work on this. </p>
<p>Althogh, I wonder if something can be done on the editor's side? One of the ideas behind LSP is that you have a persistent process.</p>



<a name="195331993"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/startup%20time/near/195331993" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/startup.20time.html#195331993">(Apr 26 2020 at 12:13)</a>:</h4>
<p>The best workaround for now would be to keep vim running and use a file picker or <code>:open</code>.</p>



<a name="195332046"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/startup%20time/near/195332046" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Bastien Orivel <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/startup.20time.html#195332046">(Apr 26 2020 at 12:14)</a>:</h4>
<p>I used to keep vim open but my workflow was ^Z fix error, if fixed open new vim with next error else do fg. I ended up with stuff like <a href="https://gist.github.com/Eijebong/ce0d6848a4d5664baae4fd8c6b39a51a" title="https://gist.github.com/Eijebong/ce0d6848a4d5664baae4fd8c6b39a51a">https://gist.github.com/Eijebong/ce0d6848a4d5664baae4fd8c6b39a51a</a> (I think that was when I updated bitflags in servo). I stopped doing that after setting up r-a because it ate my RAM.</p>



<a name="195332055"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/startup%20time/near/195332055" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Bastien Orivel <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/startup.20time.html#195332055">(Apr 26 2020 at 12:15)</a>:</h4>
<p>I guess I could just start r-a manually and modify the extension to connect to it ?</p>



<a name="195332101"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/startup%20time/near/195332101" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Bastien Orivel <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/startup.20time.html#195332101">(Apr 26 2020 at 12:16)</a>:</h4>
<p>(And yes my workflow is dumb, but muscle memory is strong...)</p>



<a name="195332248"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/startup%20time/near/195332248" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/startup.20time.html#195332248">(Apr 26 2020 at 12:21)</a>:</h4>
<p>I don't think these necessary needs a change of workflow. Ideally, you have the same workflow, but the editor reuses servers</p>



<a name="195332298"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/startup%20time/near/195332298" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Bastien Orivel <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/startup.20time.html#195332298">(Apr 26 2020 at 12:22)</a>:</h4>
<p>Time to learn typescript then <span aria-label="rofl" class="emoji emoji-1f923" role="img" title="rofl">:rofl:</span></p>



<a name="196175017"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/startup%20time/near/196175017" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Bastien Orivel <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/startup.20time.html#196175017">(May 04 2020 at 12:44)</a>:</h4>
<p>Has something changed recently ? It stopped doing full <code>cargo check</code> on startup !</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>